package cn.edu.fjnu.camera;

import android.hardware.Camera;
import android.hardware.Camera.Parameters;
import android.os.Environment;
import android.os.StatFs;

public class MenuHelper {
	private static final String TAG = "MenuHelper";
	
	public static final int NO_STORAGE_ERROR = -1;
	public static final int CANNOT_STAT_ERROR = -2;
	
	//Camera Parameters constants
	//自动闪光频率
	public static final String ANTIBANDING_50HZ = "50HZ";
	public static final String ANTIBANDING_60HZ = "60HZ";
	public static final String ANTIBANDING_AUTO = "auto";
	//白平衡
	public static final String WHITE_BALANCE_AUTO = "auto";
	public static final String WHITE_BALANCE_CLOUDY_DAYLIGHT = "cloudy-dayligh"; //多云
	public static final String WHITE_BALANCE_DAYLIGHT = "daylight";  			 //日光
	public static final String WHITE_BALANCE_FLUORESCENT = "fluorescent";		 //荧光
	public static final String WHITE_BALANCE_INCANDESCENT = "incandescent";		 //白织光
	//自动对焦
	public static final String FOCUS_MODE_AUTO = "auto";
	
	public static final int NORAML_MODE_ITEM = 1;
	public static final int STICKER_MODE_ITEM = 2;
	
	
	public static boolean hasStorage()
	{
		if(Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED))
			return true;
		else
			return false;
	}
	public static int calculatePicturesRemaining(){
		try{
			if(!hasStorage())
				return NO_STORAGE_ERROR;
			else{
				String storageDirectory = Environment.getExternalStorageDirectory().toString();
				StatFs stat = new StatFs(storageDirectory);
				float remaining = (float)stat.getAvailableBlocks() * (float)stat.getBlockSize();
				return (int)remaining;
			}	
		}catch(Exception e)
		{
			return CANNOT_STAT_ERROR;
		}
	}
	
//	public static String getFocusMode(String value)
//	{
//		
//	}
}
